package club.easin.product.dao;

import java.util.List;
import java.util.Map;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import club.easin.product.relation.UseSoftware;

@Repository
public interface UseSoftRepository extends Neo4jRepository<UseSoftware,Long>{
	
	@Query("MATCH p=(n:Range{name:{RangeName}})-[r:use_software{stage:{stage}}]->(m:soft) RETURN p")
	public List<UseSoftware> getUseSoftwares(@Param("RangeName")String rangeName,@Param("stage")String stage);
	
	@Query("MATCH (n:Range{name:{RangeName}})-[r:use_software{stage:{stage}}]->(m:soft) RETURN r.description as description ,m.shortname as shortname,m.name as name")
	public List<Map<String,Object>> getUseSoftMap(@Param("RangeName")String rangeName,@Param("stage")String stage);


}
